package T01_test_all.test09_Phone_List;

public class T09_PhoneTest {
    public static void main(String[] args) {
        T09_Phone[] arr = new T09_Phone[3];
        T09_Phone p1 = new T09_Phone("小米", 1999, "白色");
        T09_Phone p2 = new T09_Phone("苹果", 5999, "白色");
        T09_Phone p3 = new T09_Phone("三星", 6899, "白色");
        arr[0] = p1;
        arr[1] = p2;
        arr[2] = p3;
        int sum = 0;
        for (int i = 0; i < arr.length; i++) {
            T09_Phone p = arr[i];
            sum = sum + p.getPrice();
        }
        double avg = sum * 1.0 / arr.length;
        System.out.println(avg);

    }
}
